<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        /* var arr = ['一', '二', '三', '四'];
        var sum = '';
        for(var i = 0; i < arr.length; i++){
            if(i != arr.length - 1){
                sum = sum + arr[i] + '-';
            }else{
                sum = sum + arr[i];
            }
        }
        console.log(sum); */


        // 翻转
        var arr = ['一', '二', '三', '四'];
        var arr2 = [];
        //长度 arr.length
        //遍历arr[i]
        //
        for(var i = arr.length - 1; i >=0 ; i--){
            arr2[arr2.length] = arr[i];
        }
        console.log(arr2);

    </script>
</body>
</html>